home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / com_net / tcp / amitcp / netinclude / sys / stat.h < prev    next >
C/C++ Source or Header  |  2000-01-01  |  3KB  |  108 lines

  1. #ifndef SYS_STAT_H
  2. #define SYS_STAT_H
  3. /*
  4. **      $Filename: sys/stat.h $
  5. **    $Release$
  6. **      $Revision: 3.4 $
  7. **      $Date: 1994/05/02 19:25:39 $
  8. **
  9. **    Unix-compatible stat() definitions for SAS/C
  10. **
  11. **    Copyright © 1993,1994 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  12. **                  Helsinki University of Technology, Finland.
  13. **                  All rights reserved.
  14. */
  15.  
  16. #ifndef SYS_TYPES_H
  17. #include <sys/types.h>
  18. #endif
  19.  
  20. struct    __stat
  21. {
  22.     dev_t    st_dev;        /* unique device id */
  23.     ino_t    st_ino;        /* inode of file (key block) */
  24.     mode_t  st_mode;    /* Unix style mode */
  25.     u_short    st_nlink;    /* number of links (unimplemented) */
  26.     uid_t    st_uid;        /* owner's user ID */
  27.     gid_t    st_gid;        /* owner's group ID */
  28.     dev_t    st_rdev;    /* special file ID (unimplemented) */
  29.     off_t    st_size;    /* file size */
  30.     time_t    st_atime;    /* Time of last access */
  31.     time_t    st_mtime;    /* Last modification time */
  32.     time_t    st_ctime;       /* Last file status change time */
  33.     long    st_blksize;    /* Size of disk block */
  34.     long    st_blocks;    /* Size in blocks */
  35.     long    st_dosmode;    /* DOS protection bits */
  36.         short   st_type;    /* DOS file type */
  37.         char   *st_comment;     /* DOS file comment */
  38. };
  39.  
  40. #if defined(__SASC) && defined(S_IFMT)
  41. #undef S_IFMT
  42. #undef S_IFDIR
  43. #undef S_IFREG
  44. #undef S_ISCRIPT
  45. #undef S_IPURE
  46. #undef S_IARCHIVE
  47. #undef S_IREAD
  48. #undef S_IWRITE
  49. #undef S_IEXECUTE
  50. #undef S_IDELETE
  51. #endif
  52.  
  53. #define    S_ISUID    0004000        /* set user id on execution */
  54. #define    S_ISGID    0002000        /* set group id on execution */
  55. #define    S_ISVTX    0001000        /* save swapped text even after use */
  56.  
  57. #define    S_IRWXU    0000700        /* RWX mask for owner */
  58. #define    S_IRUSR    0000400        /* R for owner */
  59. #define    S_IWUSR    0000200        /* W for owner */
  60. #define    S_IXUSR    0000100        /* X for owner */
  61.  
  62. #define    S_IREAD        S_IRUSR
  63. #define    S_IWRITE    S_IWUSR
  64. #define    S_IEXEC        S_IXUSR
  65.  
  66. #define    S_IRWXG    0000070        /* RWX mask for group */
  67. #define    S_IRGRP    0000040        /* R for group */
  68. #define    S_IWGRP    0000020        /* W for group */
  69. #define    S_IXGRP    0000010        /* X for group */
  70.  
  71. #define    S_IRWXO    0000007        /* RWX mask for other */
  72. #define    S_IROTH    0000004        /* R for other */
  73. #define    S_IWOTH    0000002        /* W for other */
  74. #define    S_IXOTH    0000001        /* X for other */
  75.  
  76. #define    S_IFMT     0170000    /* type of file */
  77. #define    S_IFCHR     0020000    /* character special */
  78. #define    S_IFDIR     0040000    /* directory */
  79. #define    S_IFBLK     0060000    /* block special */
  80. #define    S_IFREG     0100000    /* regular */
  81. #define    S_IFLNK     0120000    /* symbolic link */
  82. #define    S_IFSOCK 0140000    /* socket */
  83. #define    S_IFIFO     0010000    /* named pipe (fifo) */
  84.  
  85. #define S_BLKSIZE    512    /* block size used in the stat struct */
  86.  
  87. #define    S_ISDIR(m)    ((m & 0170000) == 0040000)    /* directory */
  88. #define    S_ISCHR(m)    ((m & 0170000) == 0020000)    /* char special */
  89. #define    S_ISBLK(m)    ((m & 0170000) == 0060000)    /* block special */
  90. #define    S_ISREG(m)    ((m & 0170000) == 0100000)    /* regular file */
  91. #define    S_ISLNK(m)    ((m & 0170000) == 0120000)    /* symbolic link */
  92. #define    S_ISFIFO(m)    ((m & 0170000) == 0010000)    /* fifo */
  93. #define    S_ISSOCK(m)    ((m & 0170000) == 0140000)    /* socket */
  94.  
  95. mode_t umask(mode_t);
  96. int __chmod(const char *, int);
  97. int __fstat(int, struct __stat *);
  98. int __stat(const char *, struct __stat *);
  99. int __lstat(const char *, struct __stat *);
  100.  
  101. #define chmod __chmod
  102. #define fstat __fstat
  103. #define stat  __stat
  104. #define lstat __lstat
  105.  
  106. #endif /* SYS_STAT_H */
  107.  
  108.